package com.project.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.bean.BuyOrderBean;
import com.project.mapper.IBuyOrderInfoMapper;
import com.project.service.IBuyOrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;

@Service
@Transactional
public class BuyOrderInfoServiceImpl implements IBuyOrderInfoService {
    @Autowired
    private IBuyOrderInfoMapper buyOrderInfoMapper;
    @Override
    public IPage<BuyOrderBean> findByItem(Integer pageNO, String vendorName, LocalDate startDate, LocalDate endDate) {
        return buyOrderInfoMapper.findByItem(new Page(pageNO,3),vendorName,startDate,endDate);
    }
    @Override
    public BuyOrderBean findByOrderId(Integer buyOrderId) {
        return buyOrderInfoMapper.findByOrderId(buyOrderId);
    }
}
